<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<script>
		function* show() {
			console.log('1')
			var a = yield
			console.log('2')
			console.log(a)
		}
		var gen = show()
		gen.next(10) // 1 第一次执行到yield，但没有执行赋值
		gen.next(20) // 2 和 20
	</script>
</head>

<body>

</body>

</html>